import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
//通用
import home from '../components/home.vue'
import login from '../components/login.vue'
//进货管理
import buy from '../components/buy/buy.vue'
import buyreturn from '../components/buy/buyreturn.vue'
import buyselect from '../components/buy/buyselect.vue'
import buyreturnselect from '../components/buy/buyreturnselect.vue'
//销售管理
import sale from '../components/sale/sale.vue'
import salereturn from '../components/sale/salereturn.vue'
import saleselect from '../components/sale/saleselect.vue'
import salereturnselect from '../components/sale/salereturnselect.vue'
//库存管理
import damage from '../components/stock/damage.vue'
import overflow from '../components/stock/overflow.vue'
import warning from '../components/stock/warning.vue'
import warningselect from '../components/stock/warningselect.vue'
import nowstock from '../components/stock/nowstock.vue'
//统计报表
import supplierstate from '../components/state/supplierstate.vue'
import customerstate from '../components/state/customerstate.vue'
import buystate from '../components/state/buystate.vue'
import salestate from '../components/state/salestate.vue'
import daystate from '../components/state/daystate.vue'
import monthstate from '../components/state/monthstate.vue'
//基础资料
import supliermanager from '../components/manager/supliermanager.vue'
import customermanager from '../components/manager/customermanager.vue'
import goodsmanager from '../components/manager/goodsmanager.vue'
import stockmanager from '../components/manager/stockmanager.vue'
//系统管理
import role from '../components/system/role.vue'
import user from '../components/system/user.vue'
import log from '../components/system/log.vue'
import changePassword from '../components/system/changePassword.vue'
import logout from '../components/system/logout.vue'

export default new VueRouter({
    mode: "history",
    routes: [

        { path: "/", component: login },
        {
            path: "/home", component: home,
            children: [
                {
                    path: "buy",
                    component: buy,
                    name: "进货入库"
                },
                {
                    path: "buyreturn",
                    component: buyreturn,
                    name: "退货出库"
                },
                {
                    path: "buyselect",
                    component: buyselect,
                    name: "进货单据查询"
                },
                {
                    path: "buyreturnselect",
                    component: buyreturnselect,
                    name: "退货单据查询"
                },
                {
                    path: "sale",
                    component: sale,
                    name: "销售出库"
                },
                {
                    path: "salereturn",
                    component: salereturn,
                    name: "客户退货"
                },
                {
                    path: "saleselect",
                    component: saleselect,
                    name: "销售单据查询"
                },
                {
                    path: "salereturnselect",
                    component: salereturnselect,
                    name: "客户退货查询"
                },
                {
                    path: "damage",
                    component: damage,
                    name: "商品报损"
                },
                {
                    path: "overflow",
                    component: overflow,
                    name: "商品报溢"
                },
                {
                    path: "warning",
                    component: warning,
                    name: "库存报警"
                },
                {
                    path: "warningselect",
                    component: warningselect,
                    name: "报损报溢查询"
                },
                {
                    path: "nowstock",
                    component: nowstock,
                    name: "当前库存查询"
                },
                {
                    path: "supplierstate",
                    component: supplierstate,
                    name: "供应商统计"
                },
                {
                    path: "customerstate",
                    component: customerstate,
                    name: "客户统计"
                },
                {
                    path: "buystate",
                    component: buystate,
                    name: "商品采购统计"
                },
                {
                    path: "salestate",
                    component: salestate,
                    name: "商品销售统计"
                },
                {
                    path: "daystate",
                    component: daystate,
                    name: "按日统计分析"
                },
                {
                    path: "monthstate",
                    component: monthstate,
                    name: "按月统计分析"
                },
                {
                    path: "supliermanager",
                    component: supliermanager,
                    name: "供应商管理"
                },
                {
                    path: "customermanager",
                    component: customermanager,
                    name: "客户管理"
                },
                {
                    path: "goodsmanager",
                    component: goodsmanager,
                    name: "商品管理"
                },
                {
                    path: "stockmanager",
                    component: stockmanager,
                    name: "期初库存"
                },
                {
                    path: "role",
                    component: role,
                    name: "角色管理"
                },
                {
                    path: "user",
                    component: user,
                    name: "用户管理"
                },
                {
                    path: "log",
                    component: log,
                    name: "系统日志"
                },
                {
                    path: "changePassword",
                    component: changePassword,
                    name: "修改密码"
                },
                {
                    path: "logout",
                    component: logout,
                    name: "安全退出"
                },
            ]
        }

    ]
});